//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    internal class InternalSelection: IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("selection"))
            {
                Pane = c.GetOptionalEnum("pane", PaneType.TopLeft);
                ActiveCell = c.GetOptionalString("activeCell");
                Selection = c.GetOptionalString("sqref", "A1");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("selection"))
            {
                c.SetOptionalEnum("pane", Pane, PaneType.TopLeft);
                c.SetOptionalString("activeCell", ActiveCell);
                c.SetOptionalString("sqref", Selection, "A1"); 
            }
        }

        #endregion

        public string ActiveCell { get; set; }

        public string Selection { get; set; }

        private PaneType _pane = PaneType.TopLeft;

        public PaneType Pane
        {
            get { return _pane; }
            set { _pane = value; }
        }
	
	
    }
}
